package Snake_Game.utils;

import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

public class GameUtils {
    public static BufferedImage upImg, downImg, leftImg, rightImg, bodyImg, foodImg;

    static {
        try {
            upImg = ImageIO.read(new File("img/upHead.png"));
            downImg = ImageIO.read(new File("img/downHead.png"));
            leftImg = ImageIO.read(new File("img/leftHead.png"));
            rightImg = ImageIO.read(new File("img/rightHead.png"));
            bodyImg = ImageIO.read(new File("img/body.png"));
            foodImg = ImageIO.read(new File("img/food.png"));
        } catch (IOException e) {
            System.out.println("Error:" + e);
        }
    }

    public static int level = 1;

    public static void drawWord(Graphics g,String str,Color color,int size,int x,int y){
        g.setColor(color);
        g.setFont(new Font("仿宋",Font.BOLD,size));
        g.drawString(str,x,y);
    }
}
